! https://wg5-fortran.org/
! https://fortranwiki.org/fortran/show/HomePage
! https://gcc.gnu.org/onlinedocs/gfortran/
! https://wg5-fortran.org/documents.html
! 2018 N2146 https://wg5-fortran.org/N2101-N2150/N2146.pdf
! 2023 https://j3-fortran.org/doc/year/24/24-007.pdf

!! keywords			===========================================================
INCLUDE							! Including source text
! Types
CLASS TYPEOF CLASSOF			! Type specifier
FINAL							! FINAL statement
ENUMERATOR						! Enumerations and enumerators
! Attribute declarations and specifications
IMPLICIT NONE					! IMPLICIT statement
IMPORT ONLY NONE ALL			! IMPORT statement
NAMELIST						! NAMELIST statement
EQUIVALENCE
COMMON
! Use of data objects
ALLOCATE NULLIFY DEALLOCATE		! Dynamic association
! Expressions and assignment
ELSEWHERE						! Masked array assignment
! Execution control
CHANGE TEAM						! CHANGE TEAM construct
ENDTEAM
WHILE CONCURRENT CYCLE			! DO construct
ELSE ELSEIF THEN 				! IF construct
SELECT CASE DEFAULT RANK 		! SELECT CASE construct
ENDSELECT
SELECT TYPE IS
ENDSELECT
EXIT
GO TO GOTO						! GO TO statement
ERROR STOP
FAIL IMAGE						! FAIL IMAGE statement
NOTIFY WAIT						! NOTIFY WAIT statement
! Image control statements
SYNC ALL
SYNC IMAGES
SYNC MEMORY
SYNC TEAM
EVENT POST
EVENT WAIT
FORM TEAM
LOCK
UNLOCK
! Input/output statements
OPEN CLOSE READ WRITE PRINT
WAIT BACKSPACE END FILE ENDFILE REWIND
FLUSH
INQUIRE
! Input/output editing
FORMAT
! Program units
USE ONLY						! USE statement
BLOCK DATA
END
! Procedures
PROCEDURE
GENERIC
CALL
RESULT							! Function subprogram
ENTRY RETURN CONTAINS

! Deleted and obsolescent features
PAUSE ASSIGN

! gfortran
STRUCTURE RECORD UNION MAP

!! attribute		===========================================================
! Types
ABSTRACT BIND EXTENDS		! Derived-type definition
SEQUENCE					! Sequence type
KIND LEN 					! Derived-type parameters
! Type declaration statement
PUBLIC PRIVATE				! Accessibility attribute
ALLOCATABLE ASYNCHRONOUS
BIND NAME					! BIND attribute
CODIMENSION CONTIGUOUS
DIMENSION
EXTERNAL
INTENT IN OUT INOUT			! INTENT attribute
INTRINSIC
OPTIONAL
PARAMETER POINTER PROTECTED
SAVE
TARGET
VALUE
VOLATILE

! Components
NOPASS PASS POINTER			! proc-component-attr-spec
DEFERRED NON_OVERRIDABLE	! binding-attr
! Use of data objects
NOTIFY STAT TEAM TEAM_NUMBER		! Image selectors
ERRMSG MOLD SOURCE STAT		! ALLOCATE statement

! Execution control
LOCAL LOCAL_INIT SHARED DEFAULT NONE	! DO construct
QUIET 						! STOP and ERROR STOP statements
UNTIL_COUNT					! EVENT WAIT
NEW_INDEX					! FORM TEAM
ACQUIRED_LOCK				! LOCK and UNLOCK statements

! OPEN statement
ACCESS ACTION ASYNCHRONOUS BLANK DECIMAL DELIM ENCODING ERR FILE FORM IOMSG IOSTAT LEADING_ZERO NEWUNIT PAD POSITION RECL ROUND SIGN STATUS UNIT
! Control information list
ADVANCE ASYNCHRONOUS BLANK DECIMAL DELIM ERR EOR FMT ID IOMSG IOSTAT LEADING_ZERO  NML PAD POS REC ROUND SIGN SIZE UNIT
! INQUIRE statement
ACCESS ACTION ASYNCHRONOUS BLANK DECIMAL DELIM DIRECT ENCODING ERR EXIST FILE FORM FORMATTED ID IOLENGTH IOMSG IOSTAT NAME NAMED NEXTREC NUMBER OPENED PAD PENDING POS POSITION READWRITE RECL ROUND SEQUENTIAL SIGN SIZE STREAM UNFORMATTED UNIT WRITE

! Program units
INTRINSIC NON_INTRINSIC OPERATOR	! USE statement
ABSTRACT OPERATOR ASSIGNMENT FORMATTED UNFORMATTED	! procedure interface
ELEMENTAL IMPURE NON_RECURSIVE PURE RECURSIVE		! Intrinsic procedure definition

! gfortran
CONVERT AUTOMATIC STATIC

!! type				===========================================================
! Intrinsic types
CHARACTER COMPLEX
DOUBLE PRECISION DOUBLEPRECISION
LOGICAL
INTEGER
REAL

! intrinsic modules
EVENT_TYPE LOCK_TYPE TEAM_TYPE
! IEEE arithmetic
! ISO_C_BINDING intrinsic module

! gfortran
TYPESPEC

!! code folding		===========================================================
! Types
TYPE					! Derived-type definition
ENDTYPE
ENUM					! Enumerations and enumerators
ENDENUM
ENUMERATION TYPE
END ENUMERATION TYPE

! Expressions and assignment
WHERE					! Masked array assignment
ENDWHERE
FORALL
ENDFORALL

! Execution control
ASSOCIATE
ENDASSOCIATE
BLOCK
ENDBLOCK
!CHANGE TEAM
!ENDTEAM
CRITICAL
ENDCRITICAL
DO
ENDDO
DO
CONTINUE
IF THEN
ENDIF
SELECT CASE
ENDSELECT
SELECTCASE
ENDSELECT
SELECT TYPE
ENDSELECT
SELECTTYPE
ENDSELECT
SELECT RANK
ENDSELECT
SELECTRANK
ENDSELECT

! Program units
PROGRAM
END PROGRAM
PROGRAM
ENDPROGRAM
MODULE
ENDMODULE
SUBMODULE
ENDSUBMODULE
BLOCK DATA
ENDBLOCK DATA
BLOCKDATA
ENDBLOCKDATA

! Procedures
INTERFACE
ENDINTERFACE
MODULE PROCEDURE
ENDPROCEDURE
FUNCTION
ENDFUNCTION
SUBROUTINE
ENDSUBROUTINE
MODULE FUNCTION
ENDFUNCTION
MODULE SUBROUTINE
ENDSUBROUTINE

!! function			===========================================================
TYPE()
CLASS()
CLASSOF()
TYPEOF()
DIMENSION()
INTENT()

OPEN()
CLOSE()
READ()
WRITE()
WAIT()
BACKSPACE()
ENDFILE()
REWIND()
FLUSH()
INQUIRE()
FORMAT()

! standard intrinsic procedures
! TODO: https://gcc.gnu.org/onlinedocs/gfortran/Intrinsic-Procedures.html
ABS(A)
ACHAR(I [, KIND])
ACOS(X)
ACOSD(X)
ACOSH(X)
ACOSPI(X)
ADJUSTL(STRING)
ADJUSTR(STRING)
AIMAG(Z)
AINT(A [, KIND])
ALL(MASK, DIM)
ALLOCATED(ARRAY)
ANINT(A [, KIND])
ANY(MASK, DIM)
ASIN(X)
ASIND(X)
ASINH(X)
ASINPI(X)
ASSOCIATED(POINTER [, TARGET])
ATAN(X)
ATAN2(Y, X)
ATAN2D(Y, X)
ATAN2PI(Y, X)
ATAND(X)
ATANH(X)
ATANHPI(X)
ATOMIC_ADD(ATOM, VALUE [, STAT])
ATOMIC_AND(ATOM, VALUE [, STAT])
ATOMIC_CAS(ATOM, OLD, COMPARE, NEW [, STAT])
ATOMIC_DEFINE(ATOM, VALUE [, STAT])
ATOMIC_FETCH_ADD(ATOM, VALUE, OLD [, STAT])
ATOMIC_FETCH_AND(ATOM, VALUE, OLD [, STAT])
ATOMIC_FETCH_OR(ATOM, VALUE, OLD [, STAT])
ATOMIC_FETCH_XOR(ATOM, VALUE, OLD [, STAT])
ATOMIC_OR(ATOM, VALUE [, STAT])
ATOMIC_REF(VALUE, ATOM [, STAT])
ATOMIC_XOR(ATOM, VALUE [, STAT])

BESSEL_J0(X)
BESSEL_J1(X)
BESSEL_JN(N, X)
BESSEL_Y0(X)
BESSEL_Y1(X)
BESSEL_YN(N, X)
BGE(I, J)
BGT(I, J)
BIT_SIZE(I)
BLE(I, J)
BLT(I, J)
BTEST(I, POS)

CEILING(A [, KIND])
CHAR(I [, KIND])
CMPLX(X [, Y, KIND])
CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])
CO_MAX(A [, RESULT_IMAGE, STAT, ERRMSG])
CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])
CO_REDUCE(A, OPERATION [, RESULT_IMAGE, STAT, ERRMSG])
CO_SUM(A [, RESULT_IMAGE, STAT, ERRMSG])
COMMAND_ARGUMENT_COUNT( )
CONJG(Z)
COS(X)
COSD(X)
COSH(X)
COSHAPE(COARRAY [, KIND])
COSPI(X)
COUNT(MASK [, DIM, KIND])
CPU_TIME(TIME)
CSHIFT(ARRAY, SHIFT [, DIM])

DATE_AND_TIME([DATE, TIME, ZONE, VALUES])
DBLE(A)
DIGITS(X)
DIM(X, Y)
DOT_PRODUCT(VECTOR_A, VECTOR_B)
DPROD(X, Y)
DSHIFTL(I, J, SHIFT)
DSHIFTR(I, J, SHIFT)

EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])
EPSILON(X)
ERF(X)
ERFC(X)
ERFC_SCALED(X)
EVENT_QUERY(EVENT, COUNT [, STAT])
EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT, CMDMSG])
EXP(X)
EXPONENT(X)
EXTENDS_TYPE_OF(A, MOLD)

FAILED_IMAGES([TEAM, KIND])
FINDLOC(ARRAY, VALUE, DIM [, MASK, KIND, BACK])
FLOOR(A [, KIND])
FRACTION(X)
GAMMA(X)
GET_COMMAND([COMMAND, LENGTH, STATUS, ERRMSG])
GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS, ERRMSG])
GET_ENVIRONMENT_VARIABLE(NAME [, VALUE, LENGTH, STATUS, TRIM_NAME, ERRMSG])
GET_TEAM([LEVEL])
HUGE(X)
HYPOT(X, Y)

IACHAR(C [, KIND])
IALL(ARRAY, DIM [, MASK])
IAND(I, J)
IANY(ARRAY, DIM [, MASK])
IBCLR(I, POS)
IBITS(I, POS, LEN)
IBSET(I, POS)
ICHAR(C [, KIND])
IEOR(I, J)
IMAGE_INDEX(COARRAY, SUB, TEAM)
IMAGE_STATUS(IMAGE [, TEAM])
INDEX(STRING, SUBSTRING [, BACK, KIND])
INT(A [, KIND])
IOR(I, J)
IPARITY(ARRAY, DIM [, MASK])
ISHFT(I, SHIFT)
ISHFTC(I, SHIFT [, SIZE])
IS_CONTIGUOUS(ARRAY)
IS_IOSTAT_END(I)
IS_IOSTAT_EOR(I)

KIND(X)
LBOUND(ARRAY [, DIM, KIND])
LCOBOUND(COARRAY [, DIM, KIND])
LEADZ(I)
LEN(STRING [, KIND])
LEN_TRIM(STRING [, KIND])
LGE(STRING_A, STRING_B)
LGT(STRING_A, STRING_B)
LLE(STRING_A, STRING_B)
LLT(STRING_A, STRING_B)
LOG(X)
LOG_GAMMA(X)
LOG10(X)
LOGICAL(L [, KIND])

MASKL(I [, KIND])
MASKR(I [, KIND])
MATMUL(MATRIX_A, MATRIX_B)
MAX(A1, A2 [, A3, ...])
MAXEXPONENT(X)
MAXLOC(ARRAY, DIM [, MASK, KIND, BACK])
MAXVAL(ARRAY, DIM [, MASK])
MERGE(TSOURCE, FSOURCE, MASK)
MERGE_BITS(I, J, MASK)
MIN(A1, A2 [, A3, ...])
MINEXPONENT(X)
MINLOC(ARRAY, DIM [, MASK, KIND, BACK])
MINVAL(ARRAY, DIM [, MASK])
MOD(A, P)
MODULO(A, P)
MOVE_ALLOC(FROM, TO [, STAT, ERRMSG])
MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)

NEAREST(X, S)
NEW_LINE(A)
NEXT(A [, STAT])
NINT(A [, KIND])
NORM2(X, DIM)
NOT(I)
NULL([MOLD])
NUM_IMAGES(TEAM)
OUT_OF_RANGE(X, MOLD [, ROUND])

PACK(ARRAY, MASK [, VECTOR])
PARITY(MASK, DIM)
POPCNT(I)
POPPAR(I)
PRECISION(X)
PRESENT(A)
PREVIOUS(A [, STAT])
PRODUCT(ARRAY, DIM [, MASK])

RADIX(X)
RANDOM_INIT(REPEATABLE, IMAGE_DISTINCT)
RANDOM_NUMBER(HARVEST)
RANDOM_SEED([SIZE, PUT, GET])
RANGE(X)
RANK(A)
REAL(A [, KIND])
REDUCE(ARRAY, OPERATION [, MASK, IDENTITY, ORDERED])
REPEAT(STRING, NCOPIES)
RESHAPE(SOURCE, SHAPE [, PAD, ORDER])
RRSPACING(X)

SAME_TYPE_AS(A, B)
SCALE(X, I)
SCAN(STRING, SET [, BACK, KIND])
SELECTED_CHAR_KIND(NAME)
SELECTED_INT_KIND(R)
SELECTED_LOGICAL_KIND(BITS)
SELECTED_REAL_KIND([P, R, RADIX])
SET_EXPONENT(X, I)
SHAPE(SOURCE [, KIND])
SHIFTA(I, SHIFT)
SHIFTL(I, SHIFT)
SHIFTR(I, SHIFT)
SIGN(A, B)
SIN(X)
SIND(X)
SINH(X)
SINPI(X)
SIZE(ARRAY [, DIM, KIND])
SPACING(X)
SPLIT(STRING, SET, POS [, BACK])
SPREAD(SOURCE, DIM, NCOPIES)
SQRT(X)
STOPPED_IMAGES([TEAM, KIND])
STORAGE_SIZE(A [, KIND])
SUM(ARRAY, DIM [, MASK])
SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])

TAN(X)
TAND(X)
TANH(X)
TANPI(X)
TEAM_NUMBER([TEAM])
THIS_IMAGE(COARRAY, DIM [, TEAM])
TINY(X)
TOKENIZE(STRING, SET, TOKENS [, SEPARATOR])
TRAILZ(I)
TRANSFER(SOURCE, MOLD [, SIZE])
TRANSPOSE(MATRIX)
TRIM(STRING)

UBOUND(ARRAY [, DIM, KIND])
UCOBOUND(COARRAY [, DIM, KIND])
UNPACK(VECTOR, MASK, FIELD)
VERIFY(STRING, SET [, BACK, KIND])

COMPILER_OPTIONS()
COMPILER_VERSION()

! IEEE arithmetic
! ISO_C_BINDING intrinsic module

! misc				===========================================================
! Symbols
AND EQ EQV FALSE GE GT LE LT NE NEQV NOT OR TRUE
XOR LOC				! gfortran

! Standard intrinsic modules
ISO_FORTRAN_ENV
ATOMIC_INT_KIND ATOMIC_LOGICAL_KIND
CHARACTER_KINDS CHARACTER_STORAGE_SIZE
CURRENT_TEAM
ERROR_UNIT
FILE_STORAGE_SIZE
INITIAL_TEAM
INPUT_UNIT
INT8 INT16 INT32 INT64 INTEGER_KINDS
IOSTAT_END IOSTAT_EOR IOSTAT_INQUIRE_INTERNAL_UNIT
LOGICAL_KINDS
NUMERIC_STORAGE_SIZE
OUTPUT_UNIT
PARENT_TEAM
REAL_KINDS REAL32 REAL64 REAL128
STAT_FAILED_IMAGE STAT_LOCKED STAT_LOCKED_OTHER_IMAGE STAT_STOPPED_IMAGE STAT_UNLOCKED STAT_UNLOCKED_FAILED_IMAGE

! IEEE arithmetic
! ISO_C_BINDING intrinsic module
